<?php
namespace Modules\Auth\Providers;
use Konekt\Concord\BaseModuleServiceProvider;
use Tymon\JWTAuth\Providers\LaravelServiceProvider as JWTLaravelServiceProvider;
use Spatie\Permission\PermissionServiceProvider;
class ModuleServiceProvider extends BaseModuleServiceProvider{
    //ServiceProvider核心方法：register() boot()
    //注册该模块到Laravel服务器
    public function register(){
        parent::register();
        // 注册JWT服务提供者
        $this->app->register(JWTLaravelServiceProvider::class);
        $this->app->register(PermissionServiceProvider::class);

        
        $this->loadRoutesFrom(__DIR__.'/../Http/routes.php');
    }
    
    //boot()在所有Provider注册完成后执行
    public function boot(){
        parent::boot();//调用父类的boot()
        $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
    }
}